Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more tests for diagnostic messages #113

Open
wants to merge 9 commits into
base: p2996
Choose a base branch
from

Conversation

BaLiKfromUA
Copy link

@BaLiKfromUA BaLiKfromUA commented Nov 8, 2024

Describe your changes

My PR adds very straightforward tests to trigger complilation errors with diagnostic notes. I didn't cover all library function and all error branches. But hopefully these basic tests could be helpul for future testing of library functions.

Covered functions:

  • reflect_invoke
  • identifier_of
  • template_of
  • type_of
  • parent_of
  • operator_of
  • value_of
  • object_of
  • extract
  • can_substitute
  • substitute

I tried to follow test files pattern so for related *.pass.cpp I added *.verify.cpp files with validation of compilation error diagnostic.

Additional context

Found at least 1 bug:
Code below doesn't produce an error and prints A. But in source code of function identifier_of I see that we should error on this condition with note names of constructors are not identifiers

Maybe I am missing something...

#include <experimental/meta>
#include <iostream>


struct A {
  constexpr A() {}
};

int main() {
    std::cout << std::meta::identifier_of(^^A::A);
    // expected: names of constructors are not identifiers
    return 0;
}

@BaLiKfromUA BaLiKfromUA marked this pull request as ready for review November 8, 2024 16:54
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
…inish tests

Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
Signed-off-by: Valentyn Yukhymenko <valentin.yukhymenko@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant